<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="../node_modules/jquery/dist/jquery.js"></script>

</head>
<body>
<input type="text" value="">
<button>切换图片</button>
<br>
<img src="https://www.baidu.com/img/PCtm_d9c8750bed0b3c7d089fa7d55720d6cf.png" alt="">
    <script>
         $(function () {
             //给按钮添加
             $("button").click(()=>{
                 var src = $("input").val();
                 console.log(src);
                 $("img").attr("src",src);
             });
         });
    </script>
</body>
</html>